﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Borra;
using System.IO;

namespace DeOCop
{
    static class Program
    {
        /// <summary>
        /// Punto de entrada principal para la aplicación.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            FileInfo conf = new FileInfo("conf.xml");
            if (!conf.Exists)
            {
                StreamWriter xml = new StreamWriter("conf.xml");
                xml.WriteLine("<?xml version=\"1.0\" standalone=\"yes\"?>");
                xml.WriteLine("<directorios>");
                xml.WriteLine("\t<directorio ruta=\"\">");
                xml.WriteLine("\t\t<elemento nombre=\"\" numcopias=\"\" tipo=\"\" sql=\"\" />");
                xml.WriteLine("\t</directorio>");
                xml.WriteLine("</directorios>");
                xml.Close();
            }
            if (args.Length != 0)
            {
                DeleteOldCopies DOC = new DeleteOldCopies();
                DOC.ComienzaBorrado();
            }
            else{
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new frm_deocop());
            }
        }
    }
}
